from flask_sqlalchemy import SQLAlchemy

db = SQLAlchemy()

class User(db.Model):
    id = db.Column(db.Integer,primary_key=True,autoincrement=True)
    username = db.Column(db.String(30),unique=True,nullable=False)
    password = db.Column(db.String(150))

class Books(db.Model):
    id = db.Column(db.Integer,primary_key=True,autoincrement=True)
    name = db.Column(db.String(50))
    price = db.Column(db.Integer,default=1)
    pic = db.Column(db.String(150))
    count = db.Column(db.Integer,default=0)

class ViewCount(db.Model):
    id = db.Column(db.Integer,primary_key=True)
    url = db.Column(db.String(100))
    count = db.Column(db.Integer)